package com.ybliang.plat.user.webapp.web.controller;

import com.ybliang.plat.common.data.vo.resp.Resp;
import com.ybliang.plat.common.rpc.consumer.client.annotation.RpcReference;
import com.ybliang.plat.common.web.BaseController;
import com.ybliang.plat.common.web.annotation.IgnoreAuthentication;
import com.ybliang.plat.user.model.UserModel;
import com.ybliang.plat.user.service.UserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value="/user")
public class UserController extends BaseController {

	@RpcReference
	UserService userService;

	@IgnoreAuthentication
	@RequestMapping(value="/info")
	public Resp info() {
		UserModel user = userService.findByMobile("17688705466");
		return Resp.success("user info");
	}

	@IgnoreAuthentication
	@RequestMapping(value="/find/mobile/{mobile}")
	public Resp findByMobile(@PathVariable String mobile) {
		UserModel user = userService.findByMobile(mobile);
		return Resp.success(user);
	}



}
